//面向对象综合训练－02定义商品对象
public class Goods{
    private String id;
    private String name;
    private double price;
    private int inventory;//库存
    
    
    public Goods(){
    }
    
    public Goods(String id,String name,double price,int inventory){
        this.id=id;
        this.name=name;
        this.price=price;
        this.inventory=inventory;
    }
    
    public void setId(String id){
            this.id=id;
        }
        public String getId(){
            return id;
        }
        
        public void setName(String name){
            this.name=name;
        }
        public String getName(){
            return name;
        }
        
        public void setPrice(double price){
            this.price=price;
        }
        public double getPrice(){
            return price;
        }
        
        public void setInventory(int inventory){
            this.inventory=inventory;
        }
        public int getInventory(){
            return inventory;
        }
}


